added test and modified existing ones
various polishing around