fixed coding errors in toy script