added multiple changes regarding intentions, and cleaning some of the code