implemented loading and writing ports.