cleanup

cleanup and made a few efficiency changes.