Poor attempt at homework