Delete some dead code / cleanup
Refactor: compute target only once
Cleanup / add comment
Don't deepcopy integers
Merge pull request #32 from thomie/master

Code cleanup