implement logic