finally got csim right..