Implemented several features and fixed several bugs.