added a second main function, with proper clearing