cleaining up old PHP code that has since been duplicated in javascript
trying something else