work done ,need to refactor and add graphs