Cleaned up code

Yay for efficiency :D
Merge pull request #82 from andrejsavikin/patch-1

Cleaned up code