used 'if' statements to render each section seperately