Implemented O(log(N)) wave plotting