Almost done but still have some bugs.