Reformed the Library and Separated Main File