Fixed error found during competition, need to document