Now using database rather than php array