Implemented algorithm and added low pass filter function.