implements #5 and fix some bugs
Merge pull request #8 from javaboybr/snapshot

implements #5 and fix some bugs