finding perfect square