pathing improvements, fixing #14 and #22