Removed some more redundant code and fixed the format.