Modifications of the script
Adding a maxsize function