Switched to action paradigm. Fixed bugs.