updated trialfun to reflect offset properly