Added first (very incomplete) draft of system code