added inequality constraints and user-defined bounds; added some documentation