a small example of my js skills in a standard spaghetti style solution