Re construct the online median code