created two functions