Fixed optional parameters
fixed random output
Merge pull request #2 from hlao002/master

Fixed cp to condition