a fresh morning code with one or two bug fixes