resolved several bugs,continuing debugging.