added modulo for doubles