added print statements and custom square root