tested compiler warnings
general constructor for index