shown in figures below