cleaning script made main function