added more features, and bug fixes