Fixed memory bug in filtering.c, removed 2-d stuff