changed some code styling issues for readability