adding code for median aggregate prototypes