cleaned up quite a bit