hopefully complete function all components should be there now (probably buggy)
next step is the linking...