how to allocate income and losses for s corporations