Add endTime. Add test to package.js. Remove unwanted code and test endTime