added some rep handling. now passes first 9 test cases
added new test cases from kattis