almost finished theoretical foundations