implements store method. to be improved.