misc bits
fix sum, add sorting methods