Most companies have a policy that if you ‘invent’ something while in their employ, the company OWNS it. Software written is the property of the company.
SO... even if YOU DID IT, it belongs to others. Which, in a way, is socialism.
But you read and signed the contract.
Could you have invented it in your basement without working for the company? If so why didn't you do so?