Code modified for better readability