tested Kyle's changes. made some modifications on K