Added more fields to database. Moved a function to functions.php