updated boxAStar to return path