Cleaner calculation of complexity