implemented functions and closure