actual tests that work
fixed remarks and small bugs (apologies for big commit)