added new features, fixed bugs