Messing with detail
Fixing constraints
Fixed memory leak