polishing up script