added square function