fixed some bugs + more tests done, few left.