add function sqrt (learnt from sicp)