logic implemented