added square and cube function