using shared_ptrs and map for states
modified file format, added parsing functions