bug fixes, printing fixed