Archive for January 2008

Parsing OFAC SDN List

OFAC maintains its SDN list in different formats

.ff
.txt
.csv.
.del
.pip

The data specs for all of the above are here

The xml format is much easier to parse. Data like :

Date of birth
Id type and number (For ex : passport #)
Place of Birth
Citizenship

which are buried in comments fields for .ff file have their own tags in xml format. This makes the extraction of these fields much easier and effective.

Also, AKAs and Addresses have their own embedded tags within the master SDN entity. This alleviates the whole ordeal of joining the alternate.ff and address.ff files with the master SDN.ff file to get the whole SDN file

The xsd is here

US Treasury has lots of technical details around the SDN list

Capital Loss and Wash Sale Rule

If you own a stock which is currently making a loss but you think you want to hold for the long term then claiming capital loss might be helpful to you. Agree it is kind of late to be reminding people about this after 12/31 cut over but hopefully it will be helpful when you are ready to file your 2008 tax return.

Basically, what it means is that you can claim your stock losses as capital loss (by filing Schedule D along with you tax return) and claim as a deduction on your income tax. This will enable you to lower the amount of tax you have to pay to the IRS. However, IRS only allows 3000 dollars as the total capital loss you can claim for a year, you can certainly carry it over to next year’s tax return if you have stock losses exceeding 3000 dollars.

The thing to watch out for is the Wash Sale Rule. The idea of wash sale rule is to disallow a loss deduction when you immediately buy the same (or similar) stock from the market. IRS does not want you to sell the stock to claim the capital loss and immediately buy the stock back. If you buy the stock in less than 30 days after you sell the stock, you cannot claim capital loss deduction on your income tax return.

To be precise

A wash sale occurs when you sell or trade stock or securities at a loss and within 30 days before or after the sale you:

* Buy substantially identical stock or securities,
* Acquire substantially identical stock or securities in a fully taxable trade, or
* Acquire a contract or option to buy substantially identical stock or securities.

If you sell stock and your spouse or a corporation you control buys substantially identical stock, you also have a wash sale.

Same or Similar stock confuses me, I have read examples stating that if you sell Home Depot to claim capital loss today, you cannot buy Lowe’s tomorrow. This will trigger the “Substantially identical” stock part of the Wash Sale Rule. So to be on safe side, I never buy the stock for 30 days after I initiate my sell transaction.

Checksum for dataset comparison

While implementing software systems which need a file feed in from an external source, there is need to know whether the source data on the file has changed or not. If the source data in the file has not changed at all then there is no need to load the file into the company’s database.

More often than not, the file publishing source does not have an automated mechanism to alert the consumer (the clients needing the file) that there is change in the file. Due to this, the consumer processes have to download the file (every day maybe) from publishing source’s FTP site and then compare the records in that file with the records stored in company’s database.

The solution which I have implemented does not avoid the unnecessary download but it does avoid the comparison of source file records with the company’s database.

One of the most easiest way of keep your database in synch with the latest version of data from the producer is to utilize “checksum” functions. Unix provides checksum function (cksum, sum) as part of its standard OS build.

Steps to determine whether the currently retrieved file has changed or not are pretty simple :

1. Execute cksum (or sum or md5) on the previous copy of the file. Note : Before downloading the latest copy of the file, take a backup of the file currently saved on your file system.

2. Execute cksum on the currently downloaded file.

3. Compare two checksum numbers generated in previous steps.

If the checksums are the same, you can be rest assured that contents of the both the files are same.

MD5 is more powerful than cksum or sum but it is not part of the standard Solaris build, you may therefore might get some resistance from your server administrator to install a MD5 utility on your Solaris server. But if you already have a MD5 utility on your server, I would suggest you to take the MD5 route.

Health Savings Account (HSA)

Last benefits enrollment season, I changed my health insurance plan to high deductible health plan (HDHP) which enables me open HSA account. I think HSA Accounts are great way to save before tax money. For individuals who do not expect to have a huge medical bill every year, signing up for HDHP plan really makes sense, as they are significantly cheaper then a regular HMO or PPO plan and allow you to contribute up to $2900 dollars (for 2008) in HSA account.

The contributions made to HSA account can be invested in mutual funds, CDs, money market accounts etc. The profits made due to these investments are not taxed.

However, since it is a Health Savings Account, the only allowed withdrawals are those which are made to pay qualified medical expenses. For example : to cover your deductible, co pay etc. If in a given year you do not incur any medical expenses, the contributed amount rolls over to the next year and keeps on accumulating like a normal 401k or IRA account.

What if you keep on contributing the maximum allowable limit every year and do not have enough medical expenses? The IRS allows you to withdraw money (for whatever reason) when you turn 65. And since it follows the typical structure of a 401k or a Traditional IRA account, you will be required to pay tax at time when you make the withdrawal.

If god forbid that you have an urgent need to dip into to this account before 65 and the reason is not related to medical expenses, IRS will charge you 10% penalty on top of the regular income tax at that time. But this should not be the reason to not go with otherwise great Tax saving opportunity.

In terms of savings, you will save on monthly health insurance premiums and you will pay less tax to the government. For example if your tax bracket is 25%, you will save $725 (if you contribute $2900 towards HSA for 2008). This saving is because your income tax will be reduced by 725 dollars. This is on top of your savings made due to switching over to the HDHP plan.

Lot of banks are offering HSA account services. Rollover from one bank to another bank is allowed. I.e. if for some reason you are not happy with the customer service or the range of investments products offered in your HSA account, you can take your HSA money from that bank and transfer it to another bank which offers HSA account which suits your needs. Money has to be moved to an HSA account though.

Comments, Suggestion, Questions are always welcome.

Non Profit Organization 501(c)(3)

I recently went through an exercise of setting up a non profit organization . Tax Exempt 501(c)(3) organization from IRS’s perspective.

The process of setting up a Non Profit Organization is pretty complicated. But you don’t need to pay 600 dollars to a lawyer also to do this stuff for you. Overall the steps are as follows :

1. Setup a Corporation in the state where you want to conduct non profit activities. For me it was North Carolina. Basically, submit the articles of incorporation to your state’s Secretary of State. For N.C please visit. They even have a template of Articles of Incorporation for Non Profit Organization.

2. Request EIN number from the IRS. You can do this online here

3. Once the state authorizes your “Articles of Incorporation”, apply for Tax Exempt Status at the State and Federal (IRS) level. The only way I found out that my application was accepted was to search on their website (mentioned above) for my incorporation’s name. They did not send me a letter confirming that my application was accepted. But when I checked their website, I could download a stamped copy of my articles of incorporation (proving that my application was accepted)

3a.
For N.C. state exemption they sent me a form which was very easy to fill.

3b.
However, to get Tax Exemption (501c3) status from IRS is a different ball game. I strongly suggest you to please refer “How to Form a Nonprofit Corporation” book from Nolo (ISBN : 9781413306477)

This book takes you through a step by step process on how to fill Form 1023 (Application for Recognition of Exemption)

Time lines :

Article of Incorporation Acceptance : 4-6 weeks

EIN : Instant

N.C. State Exemption : 4-6 weeks.

Federal : Applied for in August’ 07, received in April’ 08.

Comments, Suggestions, Questions are always welcome

Scanning Watchlists

Most of the financial institutions need to have controls in place to make sure that they are not doing business with individuals/organizations which are on OFAC SDN list. This list is regularly updated by the US Treasury.

This can be a quiet challenging task as we have to look for a “needle in a haystack”. I.e: most of the company’s customers are “good” guys”. Lots of false positives are identified as a company may have credible customers having “Hussien” (let’s say) in their last name and may end up getting flagged by the company’s automated matching system.

While designing software applications which scan watchlists generated by OFAC or any other agency, the goals should be to not only identify the “bad” guy amongst their customers but to also reduce the generation of false positives. If an automated system generates a lot of false positives, the company’s staff will spend more time looking at the records of good guys that they may be unable to catch the bad guy on time.

The “rules” matrix, a table consisting of rules as to on which data fields should the customer be identified should be determined very carefully and kept up to date based on the previous findings. Basically the rules matrix should be challenged at a regular intervals to see if the matrix is still generating good “alerts” (notification that the company has a bad guy on their books) or generating a bunch of false positive items.

In addition of having a rules matrix, a system which aggregates alerts is also needed. By aggregating alerts I mean that the system should be capable of looking into the past and check whether the same person was identified in the past and if it was then what were the actions taken in the past. This will help the company’s staff to determine what actions need to be taken now.