bugfixes... and a slight algorithm change
Merge branch 'master' of https://github.com/yousufmsoliman/PennAppsX

smash all the bugs