added definitions, minor changes to problems 3&4