Removed whitespaces at end of lines, unused variable and commeted style fixed.