Final SQL (working)
New grid layout loop