Incorporate Andrew's datasource code