tidy and add docblock