change function 'addLogicForAngles'