improve docsting and rename function