Full code

Code between master and slave - works with bugs