Updated Trim method