cleaned up a bit

still has some error I can't make sense of.