added function and prompt