After following some advice on stackoverflow, let's hope this works.