Still working on pseudocode/python version