Added new function to main method