code reorganization
simplified refraction code
also negative refraction index