removed sql tweaking
increased test coverage