add function for squaring in QS algorithm
add functions in QS