Adding guts to the two functions