basic logic implemented