new implementation of calculate_focus