fixed bugs, added minor features