Updated with working code!