Add some constants for the formations
Use the integer constants and not the strings
Also use the index in the template tag