Added pydoc comments and main method