built two functions