All neuronal processes related either to internal factors like neural oscillatory states or external factors like stimuli become ultimately observable at a behavioural level. Based on this fundamental claim, my lab focuses on the intersection between cognition and motor control. We ask how a decision is transformed into a motor command with a combination of techniques including electrophysiology, optogenetics, movement tracking, machine learning and Calcium imaging. The major cortical players for these questions are the prefrontal and the motor cortex. However, the direct pathway between these two structures is surprisingly weak in rodents. We aim to decipher the roles of these different (sub)cortical pathways between prefrontal and motor cortex and to assigned specific functions. We further find it crucial to consider the internal state of a subject as it has a major impact on behaviour. This internal state can be either captured by neural oscillations or via behavioural modelling based on previous experiences of the subjects. The internal state is also strongly influenced by spontaneous ongoing behaviour which often is not task related. Thus, we include movement tracking in our analysis. With this package we aim to elucidate in interplay between external and internal factors during cognitive motor control.