major fix
minor tweak
changed median to 5