homework 2 with bugs