fixed small problems in code