Create top.jl

Just transfer of 88 lines of MATLAB code into Julia