Implemented some small changes to make the code look better