General code work and cleaning. Appears to work, still requires live testing.