seems so much easier to do in PHP, so let's go with what we know