fixed and added some basic tests