more progress on handling globals