Commented better, cleaned up some bad code.