code cleanup
random generator fixed, constraints are now used
small changes