updated form and funciton