Updated version

This version lessens the call for the end user and provides more modularized code.