Remove unused promise in test and use while loop for levels

Thanks for the review @iHiD