debug toggler cleanup
minor correction
reworked primary functions
added test