cleaned up - was weird and complicated