changed getField to take an int instead of a String (optimization)