fixed indents - pulled function from original file