week 5 homework, adding controller logic