made improvements based on Jesse's comments