Cleanup (removed warnings etc)
perfect squares implementation