updated code for consistency