Fixed data exchange, added use of MySQL-Fuunctions