improved the implementation of roam