code done for PCBC pilot project Sean@Stanford