Fixed main part - can calculate now