Finished 'flip' calculations

also caved to how variables should be defined and am no longer using
separate var's