fixed some bugs with the parameters not being synchronized.  Fixed weird bug with rays on the edge being let through in visualization.