fixed bad code exercise