extended the retrieveEvents function allot