Updated algorithm, added mesh filters for planes