added square root calculation