Final fixes, runnable version