implement logics