Added BMR function and cache funcionality