my modified version with commandmap
resolving conflicts