compiles. added index variables