Typos and duplicate line of code removed