Almost finished... just need to write detection for map ending.