Decoupled print and called functions, added test for OpenFile