implemented main method for standalone execution