some minor refactoring.
fixed opacityr for ghost piece.
Merge branch 'master' into gh-pages
updated version.