First commit
Fixing bugs, wrote a test