removed test while loop