added two functions to cachematrix.R to complete programming assignment2