Added code to align functions to step 1/8 of a turn