diff --git a/hpvm/llvm_installer/llvm_installer.sh b/hpvm/llvm_installer/llvm_installer.sh
index d7fcda4ac4de8c129e47cfce65264097e040d228..35d42dc8c41cf8f52d7038adc0d7c03e57fae900 100755
--- a/hpvm/llvm_installer/llvm_installer.sh
+++ b/hpvm/llvm_installer/llvm_installer.sh
@@ -6,12 +6,12 @@ URL="http://releases.llvm.org"
  
 WGET=wget
 
-
 CURRENT_DIR=`pwd`
 INSTALL_DIR=`pwd`/install
 BUILD_DIR=$CURRENT_DIR/$LLVM_SRC/build
 
-NUM_THREADS=16
+# Using 2 threads by default
+NUM_THREADS=2
 
 SUFFIX=".tar.xz"
 CLANG_SRC="cfe-$VERSION.src"
@@ -19,11 +19,7 @@ LLVM_SRC="llvm-$VERSION.src"
 RT_SRC="compiler-rt-$VERSION.src"
 LIBCXX_SRC="libcxx-$VERSION.src"
 LIBCXXABI_SRC="libcxxabi-$VERSION.src"
-LLDB_SRC="lldb-$VERSION.src"
 LLD_SRC="lld-$VERSION.src"
-POLLY_SRC="polly-$VERSION.src"
-OPENMP_SRC="openmp-$VERSION.src"
-CLANG_TOOLS_SRC="clang-tools-extra-$VERSION.src"
 
 
 if [ -d $LLVM_SRC ]; then
@@ -146,6 +142,7 @@ if [ $LLD_SRC != "" ]; then
 fi
 
 HPVM_DIR=$CURRENT_DIR/$LLVM_SRC/tools/hpvm
+
 if [ ! -d $HPVM_DIR ]; then
   echo Adding HPVM sources to tree
   mkdir -p $HPVM_DIR
@@ -166,11 +163,44 @@ cd $CURRENT_DIR/llvm_patches
 /bin/bash ./apply_patch.sh
 
 echo Patches applied.
+echo
+
+AUTOMATE="y"
+
+read -n 1 -p "Build and install HPVM automatically? (y or n): " AUTOMATE   
+
+if [ ! $AUTOMATE == "y" ]; then
+  echo
+  echo HPMV not installed. Exiting. 
+  exit  
+fi
+
+echo
+echo
+read  -n 2 -p "Number of threads: " NUM_THREADS
+
+if [ ! $NUM_THREADS -gt 0 ]; then
+  NUM_THREADS = 2
+  echo
+  echo Using $NUM_THREADS threads by default.   
+fi
 
+echo
 echo Now building...
 
-mkdir -p $BUILD_DIR
-mkdir -p $INSTALL_DIR
+echo Using $NUM_THREADS threads to build HPVM.
+echo
+
+cd $CURRENT_DIR
+
+if [ ! -d $BUILD_DIR ]; then
+  mkdir -p $BUILD_DIR
+fi
+
+if [ ! -d $INSTALL_DIR ]; then
+  mkdir -p $INSTALL_DIR
+fi
+
 cd $BUILD_DIR
 echo cmake ../$LLVM_SRC -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLLVM_TARGETS_TO_BUILD="X86"  -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR
 cmake ../$LLVM_SRC -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLLVM_TARGETS_TO_BUILD="X86"  -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR