Added existing code and fixed typo