tidy and function added