Implemented main entry point