code fixed
tests adjusted