added option m (not perfect)