trimmning vector data as well