quick algo fix, should work on most simple maps