fixing some typos and unnecesary code