widget re-written to do calculations in php. Should improve compatibility