writeRecord prototype

should work, but may be a pain to maintain.