Beautified code: removed extra spaces, tabs changed to spaces and added necessary semicolons