added modulo function