Implementations for functions

Added implementations for functions.