Bug fix + change int to short for permance reason