challenge 6
bug fixes, needs debug print removal