Fixed some problems with computing optimal values.
Deprecated the initializeShares (not needed enymore).