fixed result trimming
more compact lightweight form