Added total sum for other functions
Fixed conflicts ready for testing