Removed the buggy sf.clear() after precalculation