added a misplaced constant and shifted stuff.