made the changes suggested by@djkotowski and @jmmastey