completing the functionality: need to unittest them