added implementation for some functions