factored out sparseInit. Fixed DATA_DIR bug