added some working code