Revert "Deleted unneeded code"

This reverts commit b29ef213ed729a051e051281aa2c1734ab23f865.