Take a look at this post – I think it might have what you need!
Let me know if any parts of it don’t make sense or you get stuck!