theoretical part

nearly done