map reading function