edited code as per GitHub recommendations