cleaned previous code