implemented main method and loader