working version, had to update java cookbook. fixed a few issues in templates.