Added in check for if user is on spaces or tabs. Replaces with tabs or spaces now depending on settings. console.log lines still need removing