cleaned up a bit and changed comments