FINAL CODE FOLLOWING CODE CLEANUP.