Added a lot of documentation
Added a test of state-map