Basic Function Fished

2 Bugs remain: encoding and states