Remove loops in F