tweaked code so it compiles