wrote some pseudocode for param selection