UPDATE: Implemented algorithm to find the longest Chain