working loop solver