new median

Hey!
some changes made*