added in a js only version, also added in a small for loop for multiple sources