added features, fixed bugs