restructured script w/ main & corrected readme