New function for ldh project and bug fix