fix open and create functions

work on write and read, thinking of storing Q pointere instead of
variable.  Avoids datastructure copy and retains value across functons