adds print, and minor bug fixes.