Changed the design and fixed some problems