Added code for store and query