This Code works tested with main data