Added working 'square' function