Cleaned up code, but still indexes are missing