Implemented logic.