Added threshold code, data and fixed directory paths