removed trailing whitespace and fixed indentation