finally ironed out the errors