cleaning up some code, making new features work