Introduced some variables, minor bug fixes.
Added message for intentionality.