Changed keys in state to an adaptive array
Cleaned up unnecessary code. This fixes #207