fixing final issues and changing name of main function