brushed up the submittofirebase function and tested it