added wrapping, however some points still spike and cause artifacts.