written function to lookup field position in array@