Write schedules as separate table
fix offset calculation