added implementations to the functions