remove extra table element and make ex 19 based on 18 with while loop