Formatted, moved position of prevTheta setting.