added bite function
completed median function