adding get_mode and tests