Add design and fix some bugs