Cleaned up code. Removed comments. Added fields to database query.