fixing up code