change to two functions