added typo and removed redundant code
cleaned up stuff