some fixes to code

There are some quick adjustments I hope will help you understand how play with things.