Implemented most ALU functions.