Edited code to fix minor inconsistencies