I've checked my script on some test data and it works fine.