Your algorithm can make agent looping in four corners of a room, if it has exit in the middle of a wall. Also please keep your tone down a bit.