moved pool edit code from from script.js to another