Added more comments, fixed termination array.