Polished the methods and added comments