Added more features and fixed a few bugs