added a little better commenting, I need to think more to get the rest done. It's mostly there though