fixed xint logical ops
moved const to end of function throughout