updates for ng
some casting
some ops
some tests