Removed dependence on Misc, added nrow() and ncol(), added REQUIRE