Added region covering function and removed unnecessary code