added some tests. added TODO to small bugs.