debugging, results are now much closer to desired results