added edge conditions to mapper