basic logic, without drawing method