Updated code for newest ugdk