fix problems and clear up code