Revert "trimlast"

This reverts commit b2dc981aab10b972e034f4c3a3e25ea33f654343.