added debug product and cleaned up code