Added median,sd. Few debugging.