data.php fully converted... we should test the functions individually