Refactored to use mysql
modified to work in AWS