Fully functional, loop prevention is implemented but commented out