bugfix and semi implementation of map engine