finished the coding for direct calculation method