Removed while loop as it is not needed