General fixes, added pretty comments