Incorporating bwhitham's changes