fixed bugs, and update for version 1.0