Updated codes to include data directories, should work better.