square and cube function