added psudo code algorithm and data structures to be used