made some pseudocode