outline of state machine
test class to check state machine
updated collision avoidance