tested store/retrieve function, fixed some issues