Added detached states
Created possibility to detach state
Small code style fixes
Merge pull request #1 from sarunas/detached-states-pr

Detached states pr