added firebase code, still working out sorting