edited code

Added more functions and more user friendly functions.