implemented final maps and ending conditions