Created a frame processing function and laid out the foundation of the state managers lines.