Main Header where the actual algorithm is coded