Switching to address based map generation. Divided to subroutines.