Modified code to work with composer