cleaned up code for real.