cleaned previous sample code