some more steps to get matlab compatibility