untested build using single while loop, unfinished selection structures