improving final result printout
minor code cleanup