implement the 2 functions