removed newline requirement, improved primitive support