Assignment2 first try. Both functions worked with x <- matrix(rnorm(...)