began editing the main function