cleaned up by ctoscano