added functions for modulo operation