Added some cleanup code... needs cleaned up.