added map logic