Merge pull request #2 from szymonrychu/master

Merge pull request #1 from wh1tehall/master
algorith patched, except for sorting population
Merge pull request #2 from wh1tehall/master

Looks partially good, accepting