Updating demo with cleaner fix for x <= 0 bug