adding a while loop that can interpret multiple expressions