Edited code and tested in main