Cleaned up code, no more shadow warnings