removed unwanted code from main function