moved doc string into function