cleaned up, latest version without windows-specific modifications