Logic and setup

this pretty much contains all i did
there's some changes to the logic and some bug fixes
the results should be fairly balanced when no arguments are supplied
the merge could be fairly painful though