a few tweaks, remove warnings, etc
make output identical for both codes
Merged droundy's commit and made time work for me again.