implmented '[]', also includes some testing code
finished implementing index