Finished part one of the homework. Unsure if working properly.