added Juan's changes