Add function to get list element by index