Added functionality in main