pseudo code added