refactoring (use strict)
refactored pieces, fixed private.key bug