finished map manipulation and checking implementation