implemented removing spaces and blank lines