#5 improvements and debugging
#5 debug and adjustments 2