Added more documentation to code
Move script logic to main method