first working version with maps