Add the code in two functions