Changed variable declaring, changed the def command to new. Code cleanup.