Added Sample sub-generator
Fix bugs in sample generator