Cleaned up/debugged record sweep program