Make putSection Function Generic

add comments, clean up code , you can add as many sections as you can.