change states to end points for path and major refactor

not working, need to debug. hope git works :)