general debugging and added some unit tests