comments and general cleanup
fixed merge conflicts