added immediate and register detection