refactor, add Q
density tests