Clean up code Okay, this is probably cleaner and it is also less net change from the original version