Implemented basic logic.