Made 7 faster and put code in a separate function.
Made 10 faster.
Added 11.