I hope this is useful to students and others. I have not extensively tested it. Please let me know if you find any errors or if a better solution exists. I try to do my best. Thanks !