Added modifiers
Optimized algorithm
Added test class for square roots