implemented storing - with key and random key