modifying code to match my taste