modified event creating function, tested weekly recurrence (looks OK), but still need to test yearly and monthly recurrences.
tested all cases (weekly, monthly, yearly)
added get1or0() function