modularized and added new files