removed an obsolete comment
reformated a few lines
moved the condition checking whether a shell is interactive or not