fixed formatting, fixed bytes bug, implemented debugfunction