changed approach of offset calculation to 'offsetof' macro