chgned wrong enum type and added generic open function, removed one typedef