added DISMATH pseudocode implementation