fixed some bugs and worked on integration