code broken down in order to see structure