This'll do. I'm sure there are a hundred ways in which this could be more efficient but this is working.