previously committed version had some wrong changes to the models
added weighted average expiration date mechanism