implemented all rules for epidemy simulation