added some pseudocode for planning