Copywrite law is Federal but various states have regulations concerning who can obtain copywrite on computer code. In Georgia, if you write code for a customer and receive payment for it, the code itself belongs to your customer unless there is a prearrangement. This makes sense to me since the programmer is acting under the direction of the customer.
A problem is a problem only as long as it has a possible solution. Lacking that, it becomes a FACT!