adding curly braces and correct ordering links