square method is working