Switched to hw8 url (AWS) for queries; cleaned up code