fixed formatting finish pseudocode in real code later