move filtering to code because of two dimensional array