refactored main tasks file and changed send calculation logic