most pseudocode is in
complete refactoring