updated script.js - validation etc.