Modified code to use package rather than exec