Barrier Generator Done! Added comments.