Made everything workin firebase. And indented and commented code.