Removed stupidity, now works on nested loops!!, this a non-compressed code