Added positionType variable that can be used to construct byLine
The script now takes optional iamId argument