working on potential Field algorithm