I think you a matrix aka multi-dimentional array should be just the ticket, at least for the array problem... sorry, I'm just a student, don't really know stacks...