changing to modulo function in thetha