update readme and define function