Got modulo routine working