works for most use cases
todo: fix output dimentions for indexing with multi-dimentional arrays