pretty sure I finally finished this homework. Very annoying and long.