Added code for BigQ and test
Added merge function