Update test.js

Added functionality