added init method to properly initialize the system. init was done previously somewhat haphazardly