Fixing major bug with David's changes