Fixing up code so far