Added comments and refactored zFilter outside of d3 function