Moved Definitions

Moved all definitions to main file