added patterns and updated ghosts a bit.