Modified main method for testing