Fixed function call and added a doc string