Upated all method to return a key vlaue array