put state logging into its own method. going insane.