bug fix; change sequence of input to ld