try looping upwards instead, why make life harder?