move index into main script