added and modified minimizer code (initial commit)