Update math script for more features