First attempt at pseudocode