Avoid magic numbers - use named constants instead. What is the meaning of 12 in condition "i < 12".
The same for all other places in code bellow.