Removed useless code and did some formating