changed js mechanics