Id suggest you talk to a lender now and get their specific advice on improving your credit and on your best mortgage options.
you may need to search for a lender to do a mortgage under $50,000. you may have to use a credit union or a small local bank.
also if the property needs work (which in the $40,000 price range is VERY likely), you will need to go conventional or fha with a rehab mortgage.
buying a home is a lot easier if you have the right team of professionals on your side. ask your agent to refer a lender (or vice versa).... more
A Realtor can compare the homes in the neighborhood with your own - showing you what has sold, the prices of what is listed and what is under contract right now. Find someone that you know, trust and click with.
Good Luck!... more