cleaning up source code, removed some empty lines and nested source for easier editing