cleaned up a little, still needs work