adding bg estimation script