fixed some ridculous bugs and added tests and added __getitem__
convenience