working on a refactor that can work with sqrt, square or both