added working code to repo for patient1