merged more of joshes changes