Added additional features and fixed bugs