code showing the accesing of elements from the list