Untidy version of week 2's homework. Needs better structure and commenting