fixed dumb bugs
fixed unit tests