square functions working appropriately - questions about syntax though as I may have merely gotten lucky here