tidy'd up code, and added class.width parameter to selectiveBuildRoutine.