added what the algorithm to a file called comp.js