Updated mains read() usage