fix up code