all logic implemented