fixed artificial horizon error, incorrect order of operations
starting j counter fixes
replaced i and j with xCount where unclear