added foreign keys
enabled implicit conversions by compiler flag