added print functionality in addition to println functionality + updated comments