Reorganizing file structure & implementing liberty counter and capture algorithm