indexing now working;
cleaned up deprecated code