Unstable working state commit
Cleaned up code