first draft for Assignment 6 submission in case I can't make it any better