fix some spacing bugs and implement trim