refactored status handler and added output_status for debugging

and possibly live feedback.