Tweaked code after running on dev machine, majorly working