Refactored sqrt into a block