cleaning up code..errors still persist