Homework 4 memory and state machines