Updated code to use FireBase part #2