implement save & getCount methods