almost done! need to fix some bugs.