pseudo coded
initial solution
refactored a little bit
fixed a refactor bug
reflected