better smart placement algorithm