Added skeleton code for the required methods to run the algorithm smoothly.