- Fix return type of pairs
- Fix density calculation