Start of portable implementation. (Nothing working.)