codeeval.com n mod m commit. added test cases for later optimization