Removed the while(true) (was for test purposes)