Added noise functionality. Now need to optimize.