refactored a bit + added restore option
Merge pull request #2 from ryedin/master

refactored a bit + added restore option