created object correctly
added 1 line for clarity
fixed bug where state wasn't being set correctly
turned on debugging