Working and tested script for Puma (version 1.0.1)