Added code to determine which standard ports are input-only or output-only.