cleanup and add max example