created new functions for phys analysis