made python more functional. added printing code. kind of works.