clean up unused prints, and replaced 'for' with 'map'