code added for the first 2 exercise elements