Updated code with various configurations