added implementation of pure function