Use filter() instead of manually filtering for near habstars