Changed a mean function to a solve function