Implemented main method