Orginized, updated code for possible updater.