tested version of env learning and cleaned up event posting. More testing needed