write if statements to functions
update minDistplotDist
update unit tests
update unit tests