new idea for state functions