some cleanup and whitespace stripped