Complete script and fix style