added some URL parameter reading and initialization