added automated debugging
fixed bugs