more progress on local structs functions