Added comments and more user-friendly main method.