Peter - modifying the web script to work on both ends