Cleaned up. Seems to work. Will add more tests for reputation