Cleaned up, better comments.