added supporting code for LDR