rough port to Maxwell 3.0 SDK