refactored JS
modified acceptance