Created Functions, commented code