refactored this for personal use... uploading

man I haven’t written php in some time