added commands; fixed some bugs