Cleaned up digi filter code and removed unused variable.