main_program reads tags and takes desicions accordingly