JS updated to optionally use provided results container