fixes and while loop