Complete working code. It was literally 30 minutes!!!