removed some redundant features, and added rwrap for all test functions, cleaned code