added tab support and general cleanup/commenting

NOW its ready for a merge.