initial working prototype of the head/tail/some preset filter