Added more features and fixed some bugs