square and tri object function