updated port reads and writes