Starting to port matlab code to Julia