added extra fields to database as per Dan's modifications