implemented salary summation function.