My code for those who wish