Added more tests in js this time. Seems to be better. Will explain why.