Updated functionality in test.js