added more documentation, error result for prohibited r|w, MIN MAX define