Fixed the while loops....