Changed everything to PHP to lessen complications