add array index to segment to make writing easier
continue work on hal writing still ways to go