conflicts in muls due to rebase from master fixed
cleaned up bitwise functions