added a function signature and rewritten the README