Most of the replies have the correct people. On marriage certificate James, son of Daniel McAinsh (deceased) Elizabeth Paterson is listed as a Domestic Servant. Most interesting reply is the 1841 census which does not list Daniel as living with Elizabeth and her son. Assuming James was Daniel's son he must have been around in January 1840 and James is given as the illegitimate son in the parochial record of his birth Oct 1840. One has to remember that before statutory records began in 1855 the parochial records were kept by the church session clerk and are an incomplete record of events.
I've been chasing Daniel's death for 35 years with no success so have expanded family tree sideways and to date have 2782 individuals. Thank you for your efforts and suggestions