Lots of bug fixes and improvements

Still need to add 2 more states