removed while loop