Introduce indexed variables

closes #6