optimization on 4 loops
rebuild
update docco