almost working, just index issue