added renderer and state machine