added index funcionality