Changes from Linh; Improvements for small resolution