I have no idea how to get out of this loop