Fixed up discrepencies and script is working gloriously