formatting, made query more efficient