start adding median regions to package
compiles, but doesn't work right yet