Added a very basic state system