This is my solution for ASS2 in R course- coursera