added some pseudoCode