main method implemented