Return position from getPath for correct array insertion