added statemachine for status calc