porting matlab code to JS