added location tracking and unified functions that compile opcodes