Variables and while loops added. Whole script cleaned up
changed permissions on script so its executable