modified function golpear test.js