square functionality