Updated with some working code