SD code modifications