Cleaned code for sample18.