fixing a serious error in diamondjs formatDiamondInput, and adding more functionality for the rectangle display