update readme and add function