update: develop main function