Unit test dev

more cases should be covered here.