Fixed crucial one off typo
Added line item
Fixed NDATA and off by one errors