now work trajectory-based parameter conversion
fix many bugs..
add assertions
Add const