Modified, code is now easier to read