modified to fit my app