some pseudo codes