Wrote WPT Algorithm Script