Update script.js

Functions max() and min() fixed.